<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
		<meta charset="UTF-8">
	<title><?php echo ('[title]' == '['.'title'.']' ? C('WEBSITE_NAME') : '[title]');?></title>
	<meta name="viewport" content="initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="red" name="apple-mobile-web-app-status-bar-style">
	<meta name="format-detection" content="telphone=no">
	<link rel="stylesheet" href="__CDN__/css/mall.css?modify=20161026">
	<link rel="stylesheet" href="__CDN__/css/trade.css?modify=20161026">
	<link rel="stylesheet" href="__CDN__/css/red.css">
	<script type="text/javascript">
	var require = {
		baseUrl: '__CDN__/js',
		waitSeconds: 0,
		map: {
		  '*': {
			'css': '//cdn.bootcss.com/require-css/0.1.8/css.min.js',
			'text': '//cdn.bootcss.com/require-text/2.0.12/text.min.js'
		  }
		},
		shim: {
			swiper: ['jquery', 'css!//cdn.bootcss.com/Swiper/3.3.1/css/swiper.min.css'],
			lazyload: ['jquery'],
		},
		paths: {
            'jquery': '//cdn.bootcss.com/jquery/1.12.4/jquery.min',
			'template': 'template',
			'validatejs': '//cdn.bootcss.com/jquery-validate/1.15.0/jquery.validate.min',
			'weixinjs': 'https://res.wx.qq.com/open/js/jweixin-1.0.0',
			'lazyload': '//cdn.bootcss.com/jquery.lazyload/1.9.1/jquery.lazyload.min',
			'swiper': '//cdn.bootcss.com/Swiper/3.3.1/js/swiper.min',

			'mall/cart': 'h5.js?modify=20161026',
			'view/order/list': 'h5.js?modify=20161026',
			'view/balance': 'h5.js?modify=20161026',
			'module/cart/num': 'h5.js?modify=20161026',
			'order/address': 'h5.js?modify=20161026',
			'pay': 'h5.js?modify=20161026',
			'view/personal/edit': 'h5.js?modify=20161026',
			'view/personal/scoreDetail': 'h5.js?modify=20161026',
			'view/present/list': 'h5.js?modify=20161026',
			'view/score': 'h5.js?modify=20161026',
			'pay/express': 'h5.js?modify=20161026',
			'jsweixin': 'h5.js?modify=20161026',
			'skumodal': 'h5.js?modify=20161026',
			'customer_service': 'h5.js?modify=20161026',
			'order/refund': 'h5.js?modify=20161026',
			'model_pay_coupon': 'h5.js?modify=20161026',
			'login_modal': 'h5.js?modify=20161026',
			'member/collection': 'h5.js?modify=20161026',
            'pullfresh': 'h5.js?modify=20161026',
            'goods_list': 'h5.js?modify=20161026',
          	'search': 'h5.js?modify=20161026',
		}
	}
	</script>
	<?php if(IS_APP): ?><script type="text/javascript" src="__CDN__/js/appcan.min.js"></script><?php endif; ?>
	<script data-main="__CDN__/js/h5.js?modify=20161026" src="//cdn.bootcss.com/require.js/2.3.1/require.min.js"></script>
	<?php if(!APP_DEBUG){ require_once 'cs.php';echo '<img src="'._cnzzTrackPageView(1259294058).'" width="0" height="0" style="display:none;"/>'; } ?>
</head>
<body class="body-fixed">
	<div class="container">
		<div class="content">
			<div id="coupon-nav" class="tabber tabber-red tabber-n2 top-fix clearfix">
				<a class="active" href="javascript:;" data-enabled="1">客服评价</a>
				<a href="javascript:;" data-enabled="0">客服投诉</a>
			</div>
			<div id="coupon-list" class="my-coupons" >
				<div class="block block-list"></div>
			</div>
		</div>
	</div>
	<div id="shop-nav">
	<div class="shop-nav nav-menu nav-menu-1 has-menu-3">
		<div class="nav-special-item nav-item">
			<a href="/h5/mall" class="home jump_link">主页</a>
		</div>
		<div class="nav-item">
			<a class="mainmenu" href="http://mp.weixin.qq.com/s?__biz=MzI0NTQ3NzM2Ng==&mid=100004787&idx=1&sn=cf78c5f8fc9bd47bbafa73295f68d5bb&chksm=694ca92a5e3b203c67ac6ff97bb4c607e71f1994f4053ebbe6890d80e3b348d7c44cf312bcc9#rd">
				<span class="mainmenu-txt">在线客服</span>
			</a>
		</div>
	 	<div class="nav-item">
			<a href="/h5/list" class="mainmenu">
	 			<span class="mainmenu-txt">全部商品</span>
	 		</a>
		</div>
	 	<div class="nav-item">
	 		<a href="/h5/personal" class="mainmenu">
	 			<span class="mainmenu-txt">会员中心</span>
	 		</a>
	 	</div>
	</div>
    <link rel="stylesheet" href="__CDN__/css/shopnav.css?modify=20160921" type="text/css" />
</div>
	<script type="text/javascript">
	require(['pullfresh'], function(pullfresh){
		var $nav = $('#coupon-nav'),
			$container = $('#coupon-list>.block-list')
			 enabled = 1;
		
		$container.on('click', '.js-refresh',function(){
			pullfresh.doRefresh();
			return false;
		});
		
		pullfresh.showData = function(list, page, size){
			
			if(page == 1 && list.length == 0){
				pullfresh.setNoMore('');
				$container.html('<div class="empty-list"><div><h4>暂无内容</h4><p class="font-size-12">好东西，手慢无</p></div><div><a href="" class="js-refresh tag tag-big tag-orange">刷新</a></div></div>');
				return;
			}
			pullfresh.setNoMore(list.length < size);
			
			var html = '', attitude = {5:'非常满意', 4:'满意', 3:'一般',0:'未评价'};
			for(var i=0; i<list.length; i++){
				html += '<a href="javascript:;" class="block-item'+(list[i].attitude > 0 ? ' disabled' : '')+'">';
				if(list[i].attitude != 0 && list[i].message == ''){
					html += '    <div class="block-info">';
    				html += '        <div class="block-title">微信号：'+list[i].kf_weixin+'<span class="block-tag">'+attitude[list[i].attitude]+'</span></div>';
    				html += '        <div class="block-content">微信昵称：'+list[i].kf_nick+'<span class="pull-right">'+list[i].created+'</span></div>';
    				html += '    </div>';
				}else{
					 html += '		<p class="coupon-title">微信号：'+list[i].kf_weixin+'</p>';
					 html += '		<p class="coupon-title">微信昵称：'+list[i].kf_nick+'</p>';
					 html += '   	<span style="height:20px;color:#ccc;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+list[i].message+'</span>';
					 html += '		<span class="coupon-expire" style="float:right;margin-top:20px;">投诉时间:'+list[i].created + '</span>';
				}
				html += '</a>';
			}
			
			if(page == 1){
				$container.html(html);
			}else{
				$container.append(html);
			}
		}
		
		pullfresh.init({
			refresh: true,
			size: 20,
			container: $container,
			onLoad: function(parameters){
				$.ajax({
					url: '/h5/kefu?enabled='+enabled+'&offset='+parameters.offset+'&offset='+parameters.offset+'&size='+parameters.size,
					dataType: 'json',
					success: function(list){
						pullfresh.showData(list, parameters.page, parameters.size);
					},
					error: function(){
						pullfresh.showData([], parameters.page, parameters.size);
					}
				});
			}
		});
		
		$nav.on('click', 'a', function(){
            document.body.scrollTop = 0;
			var $ele = $(this);
			if($ele.hasClass('active')){
				return false;
			}
			
			enabled = $ele.data('enabled');
			$ele.addClass('active').siblings().removeClass('active');
			pullfresh.doRefresh();
			return false;
		});
	});
	</script>
</body>
</html>